'''
Author: Leo.wang wanglizhigs@163.com
Date: 2025-09-05 20:36:08
LastEditors: Leo.wang wanglizhigs@163.com
LastEditTime: 2025-09-08 21:45:55
FilePath: /medical-companion-server-python/app/hospital/models.py
Desc# The `introduction` field in the `McHospital` model is a TextField that allows for a longer text
# description or introduction about the hospital. It is defined with `null=True` and `blank=True`,
# which means that it is optional and can be left empty when creating a new `McHospital` instance.
# This field provides a space for additional information or details about the hospital that may
# not fit within the constraints of a CharField.
# The `introduction` field in the `McHospital` model is a TextField that allows for a longer text
# description or introduction about the hospital. It is defined with `null=True` and `blank=True`,
# which means that it is optional and can be left empty when creating a new `McHospital` instance.
# This field provides a space for additional information or details about the hospital that may
# not fit within the constraints of a CharField.
ription: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
from django.db import models
from app.hospital_level.models import McHospitalLevel

class McHospital(models.Model):
    name = models.CharField(max_length=200)
    icon = models.CharField(max_length=200, null=True, blank=True)
    # level = models.PositiveIntegerField()
    level = models.ForeignKey(
        McHospitalLevel,
        on_delete=models.SET_NULL,
        null=True,
        blank=True,
        db_column="level_id",
    )
    address = models.CharField(max_length=400)
    introduction = models.TextField(null=True, blank=True)
    created_time = models.DateTimeField(auto_now_add=True)
    updated_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = 'mc_hospital'
        verbose_name = '医院'
        verbose_name_plural = '医院'